/**
 *
 * jcrt and its source-code is licensed under the LGPL.
 * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
 * When copying, adapting, or redistributing this document in keeping with the guidelines above,
 * you are required to provide proper attribution to obinary.
 * If you reproduce or distribute the document without making any substantive modifications to its content,
 * please use the following attribution line:
 *
 * Copyright 2007 Atjava.com Ltd. (http://www.atjava.com) All rights reserved.
 *
 */
package com.atjava.jcrt.core.exception;

import org.apache.log4j.Logger;

/**
 * Core Exception class which will provide exception nesting functionalities.
 * @author biggie
 * @version $Revision: 1.2 $ $Date: 2008/07/10 06:53:09 $
 */
public class CoreException extends Exception {

	private static final long serialVersionUID = 1L;
    /**
     * Log4j
     */
    private Logger log = Logger.getLogger(this.getClass().getName());
    
	public CoreException(Throwable cause){
		super(cause.getMessage());
		cause.printStackTrace();
		log.error(cause.getMessage(),cause);
	}

	public CoreException(String message){
		super(message);
		log.error(message);
	}
	
	public CoreException(String message,Throwable cause){
		super(message);
		cause.printStackTrace();
		log.error(cause.getMessage(),cause);
	}
	
}
